Skip to content

Enable showing calculation results in form.js#20

Merged
mnakao merged 2 commits intoRIKEN-RCCS:mainfrom
ta-hinokihara:add-calculation
Nov 26, 2025
Merged

Enable showing calculation results in form.js#20
mnakao merged 2 commits intoRIKEN-RCCS:mainfrom
ta-hinokihara:add-calculation

Conversation

@ta-hinokihara
Copy link
Copy Markdown
Contributor

Hi,

I made a small improvement to allow calculation results to be displayed in the form.
In public/form.js, I added lines that evaluate and replace any parts wrapped in $[[ ]] after variable expansion.

Examples: $[[ #{var_1} * #{var_2} ]]

If expr returns an error, the content will be displayed as-is without any modification, ensuring that the page does not break.

I hope this small change helps improve the system. Please let me know if you have any feedback!

Thanks

@mnakao
Copy link
Copy Markdown
Contributor

mnakao commented Nov 20, 2025

Thank you very much for submitting this pull request.
We will review it carefully, so please allow us until next week to consider it.

@mnakao mnakao merged commit 1b42959 into RIKEN-RCCS:main Nov 26, 2025
@mnakao
Copy link
Copy Markdown
Contributor

mnakao commented Nov 26, 2025

@ta-hinokihara

The proposed syntax $[[ #{var_1} * #{var_2} ]] doesn’t align with the existing syntax, so I changed it to #{calc(var_1 * var_2)} for consistency.
For more details, please refer to: https://riken-rccs.github.io/OpenComposer/docs/application_ja.html#functions
Once again, thank you very much for the pull request. Your implementation was extremely helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants